3.3.62 \(\int \sec ^3(a+2 \log (c x^{\frac {i}{2}})) \, dx\) [262]

Optimal. Leaf size=58 \[ \frac {1}{2} x \sec \left (a+2 \log \left (c x^{\frac {i}{2}}\right )\right )-\frac {1}{2} i x \sec \left (a+2 \log \left (c x^{\frac {i}{2}}\right )\right ) \tan \left (a+2 \log \left (c x^{\frac {i}{2}}\right )\right ) \]

[Out]

1/2*x*sec(a+2*ln(c*x^(1/2*I)))-1/2*I*x*sec(a+2*ln(c*x^(1/2*I)))*tan(a+2*ln(c*x^(1/2*I)))

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 48, normalized size of antiderivative = 0.83, number of steps used = 3, number of rules used = 3, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.176, Rules used = {4599, 4601, 267} \begin {gather*} \frac {2 e^{i a} x \left (c x^{\frac {i}{2}}\right )^{2 i}}{\left (1+e^{2 i a} \left (c x^{\frac {i}{2}}\right )^{4 i}\right )^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sec[a + 2*Log[c*x^(I/2)]]^3,x]

[Out]

(2*E^(I*a)*(c*x^(I/2))^(2*I)*x)/(1 + E^((2*I)*a)*(c*x^(I/2))^(4*I))^2

Rule 267

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(a + b*x^n)^(p + 1)/(b*n*(p + 1)), x] /; FreeQ
[{a, b, m, n, p}, x] && EqQ[m, n - 1] && NeQ[p, -1]

Rule 4599

Int[Sec[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(d_.)]^(p_.), x_Symbol] :> Dist[x/(n*(c*x^n)^(1/n)), Subst[Int[x
^(1/n - 1)*Sec[d*(a + b*Log[x])]^p, x], x, c*x^n], x] /; FreeQ[{a, b, c, d, n, p}, x] && (NeQ[c, 1] || NeQ[n,
1])

Rule 4601

Int[((e_.)*(x_))^(m_.)*Sec[((a_.) + Log[x_]*(b_.))*(d_.)]^(p_.), x_Symbol] :> Dist[2^p*E^(I*a*d*p), Int[(e*x)^
m*(x^(I*b*d*p)/(1 + E^(2*I*a*d)*x^(2*I*b*d))^p), x], x] /; FreeQ[{a, b, d, e, m}, x] && IntegerQ[p]

Rubi steps

\begin {align*} \int \sec ^3\left (a+2 \log \left (c x^{\frac {i}{2}}\right )\right ) \, dx &=-\left (\left (2 i \left (c x^{\frac {i}{2}}\right )^{2 i} x\right ) \text {Subst}\left (\int x^{-1-2 i} \sec ^3(a+2 \log (x)) \, dx,x,c x^{\frac {i}{2}}\right )\right )\\ &=-\left (\left (16 i e^{3 i a} \left (c x^{\frac {i}{2}}\right )^{2 i} x\right ) \text {Subst}\left (\int \frac {x^{-1+4 i}}{\left (1+e^{2 i a} x^{4 i}\right )^3} \, dx,x,c x^{\frac {i}{2}}\right )\right )\\ &=\frac {2 e^{i a} \left (c x^{\frac {i}{2}}\right )^{2 i} x}{\left (1+e^{2 i a} \left (c x^{\frac {i}{2}}\right )^{4 i}\right )^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(137\) vs. \(2(58)=116\).
time = 0.13, size = 137, normalized size = 2.36 \begin {gather*} -\frac {\sec ^2\left (a+2 \log \left (c x^{\frac {i}{2}}\right )\right ) \left (\left (1+2 x^2\right ) \cos \left (a+2 \log \left (c x^{\frac {i}{2}}\right )-i \log (x)\right )+i \left (1-2 x^2\right ) \sin \left (a+2 \log \left (c x^{\frac {i}{2}}\right )-i \log (x)\right )\right ) \left (\cos \left (2 \left (a+2 \log \left (c x^{\frac {i}{2}}\right )-i \log (x)\right )\right )+i \sin \left (2 \left (a+2 \log \left (c x^{\frac {i}{2}}\right )-i \log (x)\right )\right )\right )}{2 x^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sec[a + 2*Log[c*x^(I/2)]]^3,x]

[Out]

-1/2*(Sec[a + 2*Log[c*x^(I/2)]]^2*((1 + 2*x^2)*Cos[a + 2*Log[c*x^(I/2)] - I*Log[x]] + I*(1 - 2*x^2)*Sin[a + 2*
Log[c*x^(I/2)] - I*Log[x]])*(Cos[2*(a + 2*Log[c*x^(I/2)] - I*Log[x])] + I*Sin[2*(a + 2*Log[c*x^(I/2)] - I*Log[
x])]))/x^2

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.24, size = 208, normalized size = 3.59

method result size
risch \(\frac {2 x \,c^{2 i} \left (x^{\frac {i}{2}}\right )^{2 i} {\mathrm e}^{\mathrm {csgn}\left (i c \,x^{\frac {i}{2}}\right )^{3} \pi -\mathrm {csgn}\left (i c \,x^{\frac {i}{2}}\right )^{2} \mathrm {csgn}\left (i c \right ) \pi -\mathrm {csgn}\left (i c \,x^{\frac {i}{2}}\right )^{2} \mathrm {csgn}\left (i x^{\frac {i}{2}}\right ) \pi +\mathrm {csgn}\left (i c \,x^{\frac {i}{2}}\right ) \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{\frac {i}{2}}\right ) \pi +i a}}{\left (\left (x^{\frac {i}{2}}\right )^{4 i} c^{4 i} {\mathrm e}^{2 \mathrm {csgn}\left (i c \,x^{\frac {i}{2}}\right )^{3} \pi } {\mathrm e}^{-2 \mathrm {csgn}\left (i c \,x^{\frac {i}{2}}\right )^{2} \mathrm {csgn}\left (i c \right ) \pi } {\mathrm e}^{-2 \mathrm {csgn}\left (i c \,x^{\frac {i}{2}}\right )^{2} \mathrm {csgn}\left (i x^{\frac {i}{2}}\right ) \pi } {\mathrm e}^{2 \,\mathrm {csgn}\left (i c \,x^{\frac {i}{2}}\right ) \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{\frac {i}{2}}\right ) \pi } {\mathrm e}^{2 i a}+1\right )^{2}}\) \(208\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(a+2*ln(c*x^(1/2*I)))^3,x,method=_RETURNVERBOSE)

[Out]

2*x*c^(2*I)*(x^(1/2*I))^(2*I)*exp(csgn(I*c*x^(1/2*I))^3*Pi-csgn(I*c*x^(1/2*I))^2*csgn(I*c)*Pi-csgn(I*c*x^(1/2*
I))^2*csgn(I*x^(1/2*I))*Pi+csgn(I*c*x^(1/2*I))*csgn(I*c)*csgn(I*x^(1/2*I))*Pi+I*a)/(((x^(1/2*I))^(2*I))^2*(c^(
2*I))^2*exp(2*csgn(I*c*x^(1/2*I))^3*Pi)*exp(-2*csgn(I*c*x^(1/2*I))^2*csgn(I*c)*Pi)*exp(-2*csgn(I*c*x^(1/2*I))^
2*csgn(I*x^(1/2*I))*Pi)*exp(2*csgn(I*c*x^(1/2*I))*csgn(I*c)*csgn(I*x^(1/2*I))*Pi)*exp(2*I*a)+1)^2

________________________________________________________________________________________

Maxima [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 151 vs. \(2 (40) = 80\).
time = 0.32, size = 151, normalized size = 2.60 \begin {gather*} \frac {2 \, {\left ({\left (\cos \left (a\right ) + i \, \sin \left (a\right )\right )} \cos \left (2 \, \log \left (c\right )\right ) + {\left (i \, \cos \left (a\right ) - \sin \left (a\right )\right )} \sin \left (2 \, \log \left (c\right )\right )\right )} x e^{\left (6 \, \arctan \left (\sin \left (\frac {1}{2} \, \log \left (x\right )\right ), \cos \left (\frac {1}{2} \, \log \left (x\right )\right )\right )\right )}}{{\left (\cos \left (4 \, a\right ) + i \, \sin \left (4 \, a\right )\right )} \cos \left (8 \, \log \left (c\right )\right ) + 2 \, {\left ({\left (\cos \left (2 \, a\right ) + i \, \sin \left (2 \, a\right )\right )} \cos \left (4 \, \log \left (c\right )\right ) - {\left (-i \, \cos \left (2 \, a\right ) + \sin \left (2 \, a\right )\right )} \sin \left (4 \, \log \left (c\right )\right )\right )} e^{\left (4 \, \arctan \left (\sin \left (\frac {1}{2} \, \log \left (x\right )\right ), \cos \left (\frac {1}{2} \, \log \left (x\right )\right )\right )\right )} + {\left (i \, \cos \left (4 \, a\right ) - \sin \left (4 \, a\right )\right )} \sin \left (8 \, \log \left (c\right )\right ) + e^{\left (8 \, \arctan \left (\sin \left (\frac {1}{2} \, \log \left (x\right )\right ), \cos \left (\frac {1}{2} \, \log \left (x\right )\right )\right )\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(a+2*log(c*x^(1/2*I)))^3,x, algorithm="maxima")

[Out]

2*((cos(a) + I*sin(a))*cos(2*log(c)) + (I*cos(a) - sin(a))*sin(2*log(c)))*x*e^(6*arctan2(sin(1/2*log(x)), cos(
1/2*log(x))))/((cos(4*a) + I*sin(4*a))*cos(8*log(c)) + 2*((cos(2*a) + I*sin(2*a))*cos(4*log(c)) - (-I*cos(2*a)
 + sin(2*a))*sin(4*log(c)))*e^(4*arctan2(sin(1/2*log(x)), cos(1/2*log(x)))) + (I*cos(4*a) - sin(4*a))*sin(8*lo
g(c)) + e^(8*arctan2(sin(1/2*log(x)), cos(1/2*log(x)))))

________________________________________________________________________________________

Fricas [A]
time = 2.07, size = 55, normalized size = 0.95 \begin {gather*} -\frac {2 \, {\left (2 \, x^{2} e^{\left (3 i \, a + 6 i \, \log \left (c\right )\right )} + e^{\left (5 i \, a + 10 i \, \log \left (c\right )\right )}\right )}}{x^{4} + 2 \, x^{2} e^{\left (2 i \, a + 4 i \, \log \left (c\right )\right )} + e^{\left (4 i \, a + 8 i \, \log \left (c\right )\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(a+2*log(c*x^(1/2*I)))^3,x, algorithm="fricas")

[Out]

-2*(2*x^2*e^(3*I*a + 6*I*log(c)) + e^(5*I*a + 10*I*log(c)))/(x^4 + 2*x^2*e^(2*I*a + 4*I*log(c)) + e^(4*I*a + 8
*I*log(c)))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sec ^{3}{\left (a + 2 \log {\left (c x^{\frac {i}{2}} \right )} \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(a+2*ln(c*x**(1/2*I)))**3,x)

[Out]

Integral(sec(a + 2*log(c*x**(I/2)))**3, x)

________________________________________________________________________________________

Giac [A]
time = 1.10, size = 74, normalized size = 1.28 \begin {gather*} -\frac {2 \, c^{10 i} e^{\left (5 i \, a\right )}}{c^{8 i} e^{\left (4 i \, a\right )} + 2 \, c^{4 i} x^{2} e^{\left (2 i \, a\right )} + x^{4}} - \frac {4 \, c^{6 i} x^{2} e^{\left (3 i \, a\right )}}{c^{8 i} e^{\left (4 i \, a\right )} + 2 \, c^{4 i} x^{2} e^{\left (2 i \, a\right )} + x^{4}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(a+2*log(c*x^(1/2*I)))^3,x, algorithm="giac")

[Out]

-2*c^(10*I)*e^(5*I*a)/(c^(8*I)*e^(4*I*a) + 2*c^(4*I)*x^2*e^(2*I*a) + x^4) - 4*c^(6*I)*x^2*e^(3*I*a)/(c^(8*I)*e
^(4*I*a) + 2*c^(4*I)*x^2*e^(2*I*a) + x^4)

________________________________________________________________________________________

Mupad [B]
time = 4.48, size = 56, normalized size = 0.97 \begin {gather*} \frac {2\,x\,{\mathrm {e}}^{a\,1{}\mathrm {i}}\,{\left (c\,x^{\frac {1}{2}{}\mathrm {i}}\right )}^{2{}\mathrm {i}}}{2\,{\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\left (c\,x^{\frac {1}{2}{}\mathrm {i}}\right )}^{4{}\mathrm {i}}+{\mathrm {e}}^{a\,4{}\mathrm {i}}\,{\left (c\,x^{\frac {1}{2}{}\mathrm {i}}\right )}^{8{}\mathrm {i}}+1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/cos(a + 2*log(c*x^(1i/2)))^3,x)

[Out]

(2*x*exp(a*1i)*(c*x^(1i/2))^2i)/(2*exp(a*2i)*(c*x^(1i/2))^4i + exp(a*4i)*(c*x^(1i/2))^8i + 1)

________________________________________________________________________________________